package com.xnyzc.lhy.mis.mapper.user;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xnyzc.lhy.mis.entity.result.cms.driver.CmsDriverSettlementDataListRes;
import com.xnyzc.lhy.mis.entity.result.cms.driver.CmsTransferHistoryChildRes;
import com.xnyzc.lhy.mis.entity.result.cms.driver.CmsTransferHistoryRes;
import com.xnyzc.lhy.mis.entity.user.OaDDriverCash;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author cuixiaojian
 * @since 2021-05-31
 */
public interface OaDDriverCashMapper extends BaseMapper<OaDDriverCash> {

    List<CmsDriverSettlementDataListRes> selectAmountListByBatchId(@Param("batchNo") long batchNo, @Param("index") Long index,@Param("limit") Long limit);

    @Select("select count(1) from oa_d_driver_cash where batch_id = #{batchNo}")
    Integer selectAmountCount(@Param("batchNo") long batchNo);

    @Select("select SUM(trsamt) as totalAmount FROM oa_d_driver_cash WHERE batch_id = #{batchNo} ")
    String selectTotalAmount(Long batchNo);

    List<CmsTransferHistoryRes> selectTransferHistoryRecordList();

    List<CmsTransferHistoryChildRes> selectTransferHistoryChildList(@Param("batchNo") Long batchNo);
}
